<?php
  require('../action/db.php');
  require('/usr/local/lib/php/Smarty/Smarty.class.php');
  $smarty = new Smarty();

  $smarty->setTemplateDir('../smarty/templates');
  $smarty->setCompileDir('../smarty/templates_c');
  $smarty->setCacheDir('../smarty/cache');
  $smarty->setConfigDir('../smarty/configs');
  $rs = $db->Execute('select * from SPIDER_PRODUCT_BRAND  group by product_class');
  $product_class_list = $rs->getRows();

  $rs = $db->Execute("select * from SPIDER_PRODUCT_BRAND where product_class='".$product_class_list[0]["product_class"]."' group by product_class,product_brand");
  $product_brand_list = $rs->getRows();

  $rs = $db->Execute("select * from SPIDER_PRODUCT_BRAND where product_class='".$product_class_list[0]["product_class"]."' and product_brand='".$product_brand_list[0]["product_brand"]."'");
  $product_sub_brand_list =$rs->getRows();
  $rs = $db_sns->Execute("select id,title from bx_groups_main");
  $sns_group_list = $rs->getRows();

  $smarty->assign('product_class', $product_class_list);
  $smarty->assign('product_brand', $product_brand_list);
  $smarty->assign('product_sub_brand',$product_sub_brand_list);
  $smarty->assign('sns_group',$sns_group_list);
  $smarty->display('product_add.tpl');
?>
